﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QD.Web.ActionResult
{
    public class ActionResultWeb
    {
        private string _error;

        public string Error
        {
            get { return _error; }
            set { _error = value; }
        }


        private string _message;

        public string Message
        {
            get { return _message; }
            set { _message = value; }
        }


        private object _returnValue;

        public object ReturnValue
        {
            get { return _returnValue; }
            set { _returnValue = value; }
        }


        private string _warning;

        public string Warning
        {
            get { return _warning; }
            set { _warning = value; }
        }


        public bool IsError
        {
            get
            {
                return !string.IsNullOrEmpty(this._error);
            }
        }


        public bool IsWarning
        {
            get
            {
                return !string.IsNullOrEmpty(this._warning);
            }
        }

        public void AddErrorLine(string error)
        {
            this._error = this._error + error + "\n";
        }
        public void AddMessageLine(string message)
        {
            this._message = this._message + message + "\n";
        }
        public void AddWarningLine(string warning)
        {
            this._warning = this._warning + warning + "\n";
        }

    }
}
